Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP example Snippets for API methods #1

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

FATCHIP-GmbH
Copy link

No description provided.

Bugfighter and others added 4 commits October 13, 2020 00:45
* 0067954 - adding getArticlesFull

* 0067954 - Adding getArticlesDelta example

* 0067954 - Adding getArticlesDelta example

* 0067954 - setting curl timeout to one hour

* 0067954 - Adding example for get (and confirm) Orders

* 0067954 - Adding getOrderMessages example

* 0067954 Added call example for Set Stocks

* 0067954 Adding SetOrder file and minor adjustments

* 0067954 Adding SetOrderMessages file and adjustments to setOrder so they have the similar templates

* 0067954 - Excluding some optional fields

* 0067954 - Rename files

* 0067954 - Adding Send Articles

* 0067954 - Adding comments to "send" files and correcting the ones for orders

* 0067954 - Correction to the url response after receiving order messages
Copy link
Member

@kinimodmeyer kinimodmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your Contribution! 👍

  1. for logical issues i made inline comments.
  2. for the syntax we should follow the php standard psr 12.

you can do the following to detect the ~150 errors and easy fix them:

  1. download phpcs/phpcbf: wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar / wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
  2. check your folder for errors with "php phpcs.phar --standard=PSR12 php"
  3. automatically fix the folder with "php phpcbf.phar --standard=PSR12 php"
  4. fix the 5 remaining errors manually.

php/getOrderMessages.php Outdated Show resolved Hide resolved
php/getOrderMessages.php Outdated Show resolved Hide resolved
/**
* Sending confirmation to Tradebyte
*/
sendExportedFlagToTradebyte($ordersImported, $sMerchantId, $sApiUser, $sApiPassword);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on the messages example we do the confirmation at the end inside of the loop and not collecting the message identifiers. i would suggest the same process here.

php/getOrders.php Outdated Show resolved Hide resolved

function sendExportedFlagToTradebyte($arrayOfIds, $sMerchantId, $sApiUser, $sApiPassword){

foreach ($arrayOfIds as $orderId){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment above, remove loop here

php/sendOrderMessages.php Outdated Show resolved Hide resolved
php/sendOrderMessages.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants